package com.youcheng.receiver;


import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class PublishAndSubscribe {

    @RabbitListener(queues = "helloA") //监听queueName这个队列
    @RabbitHandler
    public void process(String hello) {
        System.out.println("helloA Receiver  ===================: " + hello);
    }

    @RabbitListener(queues = "helloB") //监听queueName这个队列
    @RabbitHandler
    public void process1(String hello) {
        System.out.println("helloB Receiver  ===================: " + hello);
    }

}
